package com.iot.iotplus.controller;

import com.iot.iotplus.base.Result;
import com.iot.iotplus.service.MessageService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.CrossOrigin;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
@CrossOrigin
@RequestMapping("/message")
public class MessageController {
    @Autowired
    private MessageService messageService;
    //获取空气温度列表
    @RequestMapping("/tem/{id}")
    public Result<?> getAirTemperatures(@PathVariable("id") String id) {
        return messageService.getAirTemperatures(id);
    }
    //获取空气湿度列表
    @RequestMapping("/hum/{id}")
    public Result<?> getAirHumidity(@PathVariable("id") String id) {
        return messageService.getAirHumidity(id);
    }

}
